<!DOCTYPE html>
<html lang="en">
<head>
	<include data="head.html">
	<title>{$title}</title>
	<style>
	#plugins-list-div{min-height: 20px;}
	#inner-container{padding: 10px 10px 0 10px;}
	#upload-zip{margin-bottom: 20px;}
	#select-plugin button[type=submit], #select-plugin button[type=reset]{display: none;}
	a.action{margin-left: 5px;}
	a.action.disabled{color: #777;}
	.new-version, .update{display: none;}
	.new-version>code{margin-right: 5px;line-height: 2;}
	</style>
</head>
<body data-menu="plugins">
	<div class="container">
		<ul class="nav nav-tabs" role="tablist">
			<li role="presentation" data="default" class="active">
				<a href="plugins.html">选择插件</a>
			</li>
			<li role="presentation" data="upload">
				<a href="plugins.html?tablist=upload">上传</a>
			</li>
		</ul>
		<if data="empty($_GET['tablist'])">
			<div id="plugins-list-div">
				<form id="select-plugin" action="{SITE_URL}mod.php?mod::config" method="post">
					{!$i=0}
					<foreach data="$plugins as $folder => $plugin">
						<div class="media">
							<div class="media-left">
								<div class="media-logo">
									{admin_get_plugin_icon($folder, $plugin['logo'])}
								</div>
							</div>
							<div class="media-body">
								<h4 class="media-heading">{$plugin['name']}</h4>
								<p class="media-content">{$plugin['desc']}</p>
								<p class="media-meta">
									<span>作者：{$plugin['author']}</span>
									<span>版本：{$plugin['version']}</span>
									<span>链接：<a title="点击访问" target="_blank" href="{$plugin['url']}">{$plugin['url']}</a></span>
								</p>
								<p class="media-footer">
									<label class="checkbox-inline">
										<input type="checkbox" data-plugin="{$folder}"{$plugin['enable'] ? ' checked' : ''}> 启用
									</label>
									<a class="action{$folder == 'post-like' ? ' disabled' : ''}"{$folder == 'post-like' ? 'title="这是内置插件，请将其拷贝为一个新插件后再进行编辑"' : ''} href="advanced/file-editor.html?type=plugin&folder={$folder}">编辑</a>
									<if data="!$plugin['enable']">
										<a  class="action delete" href="javascript:;" data-folder="{$folder}" data-type="plugin">删除</a>
									</if>
									<if data="$plugin['hasTemp']">
										<a class="action remove-temp" href="javascript:;" data-folder="{$folder}" data-type="plugin" title="这个插件存在编译文件，如果你对其进行了修改或更新，请删除其缓存副本">清除缓存</a>
									</if>
								</p>
								<if data="$plugin['versionURL']">
									<p class="media-footer">
										<button type="button" class="btn btn-sm btn-default check-new" data-loading-text="检测中..." data-version="{$plugin['version']}" data-version-url="{$plugin['versionURL']}" data-type="plugin">检查更新</button>
										<span class="new-version">
											新版本：<code>无</code><a href="#">查看更新说明</a>
										</span>
										<button type="button" class="btn btn-sm btn-default update" data-loading-text="更新中..." data-type="plugin">更新</button>
									</p>
								</if>
							</div>
						</div>
						{!$i++}
					</foreach>
					<button type="submit">更改</button>
					<button type="reset">重置</button>
				</form>
			<elseif data="$_GET['tablist'] == 'upload'">
				<div id="inner-container">
					<if data="stripos(config('file.upload.acceptTypes'), 'zip') !== false">
						<p>请上传一个大小不超过 <strong>{$uploadLimit}</strong> 的 zip 文件。<br>并确保压缩包中仅存在一个文件夹（即插件文件夹）,并且在文件夹下有一个 <strong>info.json</strong> 文件用来描述插件信息。</p>
						<button class="btn btn-success" id="upload-zip" data-loading-text="正在上传..." data-type="plugin">选择文件</button>
						<else>
							<p>请先在在设置中将 zip 加入允许上传文件类型列表。</p>
						</else>
					</if>
				</div>
			</elseif>
		</if>
	</div>
	<include data="foot.html">
	<import data="js/features.js">
</body>
</html>